import React, { Component } from 'react';
import MomentStrip from '@/components/MomentStrip/index.jsx';
import { getMoment } from '@/api/index';

export default class index extends Component {
  state = {
    dataList: [],
  };
  componentDidMount() {
    getMoment().then((res) => {
      this.setState({ dataList: res.data });
    });
  }
  render() {
    return (
      <div>
        {this.state.dataList.map((item, index) => {
          return <MomentStrip pieceData={item} key={index} />;
        })}
      </div>
    );
  }
}
